package com.binc.testspring.rabbitmq.listener;

import com.binc.testspring.dto.Student;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
// @RabbitListener(queues = "objectQueue1")
public class RecieveObject {

    //@RabbitHandler 来实现具体消费
    @RabbitHandler
    public void queueRecieve(Student student){ //接收对象是个消息
        System.out.println("接收队列objectQueue1的消息， 消息到达："+student);
    }

}
